package cn.yx.sys.remote.service.impl;

import cn.yx.sys.dto.SysLogDto;
import cn.yx.sys.remote.dto.SysLogRemoteDto;
import cn.yx.sys.remote.mapping.SysLogRemoteMapping;
import cn.yx.sys.remote.service.SysLogRemoteService;
import cn.yx.sys.service.SysLogService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;

/**
 * <p>系统日志远程服务接口实现类</p>
 *
 * @author Wgssmart
 */
@DubboService
@Slf4j
public class SysLogRemoteServiceImpl implements SysLogRemoteService {

    private final SysLogService sysLogService;

    public SysLogRemoteServiceImpl(SysLogService sysLogService) {
        this.sysLogService = sysLogService;
    }

    @Override
    public boolean save(SysLogRemoteDto sysLogRemoteDto) {
        SysLogDto sysLogDto = SysLogRemoteMapping.INSTANCE.otherToDto(sysLogRemoteDto);
        return sysLogService.save(sysLogDto);
    }
}
